package com.example.demo.config;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import java.util.Collection;

public class LoginUser extends User {
    private static final long serialVersionUID = 1L;
    private final long id;
    public LoginUser(long id, String username, String password, Collection<? extends GrantedAuthority> authorities) {
        this(id,username,password,true,true,true,true,authorities);
    }
    public LoginUser(long id, String username,String password, boolean enabled, boolean accountNonExpired,
                     boolean credentialsNonExpired, boolean accountNonLocked,
                     Collection<? extends GrantedAuthority> authorities) {
        super(username,password,enabled,accountNonExpired,credentialsNonExpired,accountNonLocked,authorities);
        this.id = id;
    }
    public long getId() {
        return id;
    }
}
